/*
 * Copyright (c) 2002-2003 by OpenSymphony
 * All rights reserved.
 */
package org.jackysoft.opensymphony.workflow.config;

import java.net.URL;
import java.util.Map;

import org.jackysoft.opensymphony.workflow.FactoryException;
import org.jackysoft.opensymphony.workflow.StoreException;
import org.jackysoft.opensymphony.workflow.util.VariableResolver;
import org.jackysoft.service.WorkflowService;
import org.jackysoft.service.VariableService;



/**
 * Configuration object that is responsible for all 'static' workflow information.
 * This includes loading of workflow configurations, setting up the workflow
 * descriptor factory, as well as proxying calls to the underlying descriptor
 * factory.
 * Date: Mar 22, 2004
 * Time: 3:42:19 PM
 *
 * @author hani
 */
public interface Configuration {
    //~ Methods ////////////////////////////////////////////////////////////////

    /**
     * @return true if this factory has been initialised.
     * If the factory is not initialised, then {@link #load(java.net.URL)}
     * will be called.
     */
    boolean isInitialized();

    /**
     * Check if a particular workflow can be modified or not.
     * @param name The workflow name.
     * @return true if the workflow can be modified, false otherwise.
     */
    boolean isModifiable(String name);

    /**
     * Get the fully qualified class name of the persistence store.
     */
    String getPersistence();

    /**
     * Get the persistence args for the persistence store.
     * Note that this returns the actual args and not a copy,
     * so modifications to the returned Map could potentially
     * affect store behaviour.
     */
    Map getPersistenceArgs();

    /**
     * Return the resolver to use for all variables specified in scripts
     */
    VariableResolver getVariableResolver();

    
    WorkflowService getWorkflowService() throws StoreException;
    VariableService getWorkflowVariableService() throws StoreException;
    /**
     * Load the specified configuration file.
     * @param url url to the configuration file.
     */
    void load(URL url) throws FactoryException;
    
    
}
